/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package FileInformation.providers;

import java.util.HashMap;
import java.util.Map;


/**
 *
 * @author Nobody
 */
public class DataSeparatorProvider  {
    private Map<DataSeparatorEnum,String> separators = new HashMap<DataSeparatorEnum,String>();
    private DataSeparatorEnum chosenSeparator = null;

    public DataSeparatorProvider() {
        fillSeparators();
    }

    private void fillSeparators() {
      separators.put(DataSeparatorEnum.SEMICOLON,";");
      separators.put(DataSeparatorEnum.COMA,",");
      separators.put(DataSeparatorEnum.TAB,"\t");
      separators.put(DataSeparatorEnum.SPACE," ");
      separators.put(DataSeparatorEnum.WHITE_SPACES,"\\s+");
    }

    public Map<DataSeparatorEnum, String> getSeparators() {
        return separators;
    }

    public void setChosenSeparator(DataSeparatorEnum chosenSeparator) {
        this.chosenSeparator = chosenSeparator;
    }

    public String getChosenSeparatorValue(){
        return separators.get(chosenSeparator);
    }

    public String get(DataSeparatorEnum key) {
        return separators.get(key);
    }

}
